@import url('https://fonts.googleapis.com/css?family=Muli&display=swap');

* {
    box-sizing: border-box;
}



body {
    /* 水平居中 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;

    margin: 0;
    overflow: hidden;
    color: #fff;
    background-color: steelblue;
    font-family: 'Muli', serif;
}

.container {
    padding: 20px 40px;
    /* 颜色直接 半透明 */
    background-color: rgba(0, 0, 0, .4);
    border-radius: 5px;
}

h1 {
    margin-bottom: 30px;
    text-align: center;
}

.container .btn {
    /* 按钮独占一行 */
    display: inline-block;
    padding: 15px;
    width: 100%;
    background-color: lightblue;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
}

.btn:focus {
    outline: 0;
}

.btn:hover {
    background-color: steelblue;
}

.btn:active {
    transform: scale(.98);
}

/* 输入栏 */
.form-control {
    position: relative;
    margin: 20px 0 40px;
    width: 300px;
}

/* 输入框 */
.form-control input {
    display: inline-block;
    padding: 15px;
    width: 100%;

    font-size: 18px;
    color: #fff;
    background-color: transparent;
    border: 0;
    border-bottom: solid 2px #fff;
}

.form-control input:focus,
.form-control input:valid {
    outline: 0;
    border-color: lightblue;
}

.form-control label {
    /* 调整位置 */
    position: absolute;
    top: 15px;
    left: 0;
    /* 禁止鼠标事件 */
    pointer-events: none;
}

/* 关键点: 即将被拆分出来的span的样式 */
.form-control label span {
    /* 行内元素:拆分出来的字符刚好排成一排 */
    display: inline-block;
    min-width: 5px;
    font-size: inherit;
    /* 这个曲线,我叫它 果冻速度 */
    transition: .3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 关键点:当聚焦以及输入值有效时,变色以及移位 */
.form-control input:focus+label span,
.form-control input:valid+label span {
    color: lightblue;
    transform: translateY(-30px);
}

p.text {
    margin-top: 30px;
}

a {
    text-decoration: 0;
    color: lightblue;
}

a:hover {
    color: steelblue;
}